<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>用户登录 - 三国杀风格</title>
    <style>
        body {
            background-color: #2d2d2d;
            font-family: 'SimSun', serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        #box {
            background-color: rgba(0, 0, 0, 0.7);
            border: 2px solid #a68e6b;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(166, 142, 107, 0.5);
            padding: 40px;
            width: 300px;
            display: flex;
            flex-direction: column;
        }
        h1 {
            color: #a68e6b;
            margin-bottom: 30px;
            text-align: center;
            font-size: 28px;
            text-shadow: 0 0 10px #a68e6b;
        }
        .input-group {
            margin-bottom: 20px;
            text-align: left;
        }
        .input-group label {
            display: block;
            margin-bottom: 5px;
            color: #a68e6b;
            font-size: 18px;
        }
        .input-group input {
            width: 100%;
            padding: 10px;
            border: 1px solid #a68e6b;
            border-radius: 5px;
            box-sizing: border-box;
            background-color: rgba(0, 0, 0, 0.3);
            color: #a68e6b;
            font-size: 16px;
        }
        input[type="submit"] {
            background-color: #a68e6b;
            color: #000;
            padding: 12px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            width: 100%;
            font-size: 18px;
            font-weight: bold;
            text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
        }
        input[type="submit"]:hover {
            background-color: #c7a87c;
        }
        .error-message {
            background-color: rgba(128, 0, 0, 0.7);
            color: #ffcc00;
            border: 1px solid #ffcc00;
            border-radius: 5px;
            padding: 10px;
            margin-top: 20px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease-in-out;
            font-size: 16px;
        }
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .error-icon {
            margin-right: 10px;
            font-size: 20px;
            color: #ffcc00;
        }
    </style>
</head>
<body>
<form action="${pageContext.request.contextPath}/login1" method="post">
    <div id="box">
        <h1>用户登录</h1>
        <div class="input-group">
            <label for="username">用户名</label>
            <input type="text" id="username" name="username">
        </div>
        <div class="input-group">
            <label for="password">密码</label>
            <input type="password" id="password" name="password">
        </div>
        <input type="submit" value="登录">
        <!-- 显示错误信息 -->
        <c:if test="${not empty kyo}">
            <div class="error-message" id="errorMessage">
                <span class="error-icon">⚠️</span>
                    ${kyo}
            </div>
        </c:if>
    </div>
</form>
<script>
    const errorMessage = document.getElementById('errorMessage');
    if (errorMessage) {
        setTimeout(() => {
            errorMessage.style.display = 'none';
        }, 1000);
    }
</script>
</body>
</html>
